/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View,
  InteractionManager,
  TouchableHighlight
} from 'react-native';
import SplashScreen from 'react-native-splash-screen';

export default class WelcomeScreen extends Component {

    static navigationOption={
          title:'',
    };
   
 componentDidMount(){
    const {navigate} =this.props.navigation;

    this.timer=setTimeout(()=> {
        InteractionManager.runAfterInteractions(()=>{
            SplashScreen.hide();
            navigate('Login');
        });
    }, 500);
 }

 componentWillUnmount(){
    this.timer && clearTimeout(this.timer);
 }

  render() {
    const {navigate} =this.props.navigation;

    return (
      <View style={styles.container}>
      <TouchableHighlight onPress={()=>navigate('Login')}>
         <Text>splash screen</Text>
      </TouchableHighlight>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  }
});
